Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): when saving picture to gallery make sure the folder exist #2016

Merged
merged 1 commit into from
Oct 15, 2019
Merged

Conversation

nj-coder
Copy link
Contributor

@nj-coder nj-coder commented Oct 1, 2019

Problem

The camera throws "Unable to create photo on disk" error when saveToGallery is set to true on Android 5.1. This PR fixes the issue by calling the mkdirs() to create the directory. Fixes the issue #2013

Sources

As adopted from cordova-camera-plugin
https://github.com/apache/cordova-plugin-camera/blob/master/src/android/CameraLauncher.java#L610

@jcesarmobile jcesarmobile changed the title fix(android): added mkdirs() to create the directory for Camera Plugin fix(android): when saving picture to gallery make sure the folder exist Oct 15, 2019
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't able to reproduce on any of my devices or simulators, but won't do any harm to create the folder if it doesn't exist, so going to merge.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants